-2001-02-19 <alla@lysator.liu.se>
+2001-02-19 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkimage-fb.c (gdk_image_new_bitmap):
+ Copy data and free data with free().
+
+ * gdk-pixbuf/gdk-pixbuf.c:
+ * gdk-pixbuf/io-jpeg.c:
+ * gdk-pixbuf/io-png.c:
+ Use g_try_malloc/g_free instead malloc/free.
+
+ * gdk-pixbuf/test-gdk-pixbuf.c:
+ Must... initialize... gobject...
+
+ * gdk-pixbuf/pixops/timescale.c:
+ * gtk/gtkcalendar.c:
+ Use g_malloc instead of malloc.
+
+2001-02-19 Alexander Larsson <alla@lysator.liu.se>
* gtk/testgtkrc:
Comment out property assignments, these don't work yet.
-2001-02-19 <alla@lysator.liu.se>
+2001-02-19 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkimage-fb.c (gdk_image_new_bitmap):
+ Copy data and free data with free().
+
+ * gdk-pixbuf/gdk-pixbuf.c:
+ * gdk-pixbuf/io-jpeg.c:
+ * gdk-pixbuf/io-png.c:
+ Use g_try_malloc/g_free instead malloc/free.
+
+ * gdk-pixbuf/test-gdk-pixbuf.c:
+ Must... initialize... gobject...
+
+ * gdk-pixbuf/pixops/timescale.c:
+ * gtk/gtkcalendar.c:
+ Use g_malloc instead of malloc.
+
+2001-02-19 Alexander Larsson <alla@lysator.liu.se>
* gtk/testgtkrc:
Comment out property assignments, these don't work yet.
-2001-02-19 <alla@lysator.liu.se>
+2001-02-19 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkimage-fb.c (gdk_image_new_bitmap):
+ Copy data and free data with free().
+
+ * gdk-pixbuf/gdk-pixbuf.c:
+ * gdk-pixbuf/io-jpeg.c:
+ * gdk-pixbuf/io-png.c:
+ Use g_try_malloc/g_free instead malloc/free.
+
+ * gdk-pixbuf/test-gdk-pixbuf.c:
+ Must... initialize... gobject...
+
+ * gdk-pixbuf/pixops/timescale.c:
+ * gtk/gtkcalendar.c:
+ Use g_malloc instead of malloc.
+
+2001-02-19 Alexander Larsson <alla@lysator.liu.se>
* gtk/testgtkrc:
Comment out property assignments, these don't work yet.
-2001-02-19 <alla@lysator.liu.se>
+2001-02-19 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkimage-fb.c (gdk_image_new_bitmap):
+ Copy data and free data with free().
+
+ * gdk-pixbuf/gdk-pixbuf.c:
+ * gdk-pixbuf/io-jpeg.c:
+ * gdk-pixbuf/io-png.c:
+ Use g_try_malloc/g_free instead malloc/free.
+
+ * gdk-pixbuf/test-gdk-pixbuf.c:
+ Must... initialize... gobject...
+
+ * gdk-pixbuf/pixops/timescale.c:
+ * gtk/gtkcalendar.c:
+ Use g_malloc instead of malloc.
+
+2001-02-19 Alexander Larsson <alla@lysator.liu.se>
* gtk/testgtkrc:
Comment out property assignments, these don't work yet.
-2001-02-19 <alla@lysator.liu.se>
+2001-02-19 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkimage-fb.c (gdk_image_new_bitmap):
+ Copy data and free data with free().
+
+ * gdk-pixbuf/gdk-pixbuf.c:
+ * gdk-pixbuf/io-jpeg.c:
+ * gdk-pixbuf/io-png.c:
+ Use g_try_malloc/g_free instead malloc/free.
+
+ * gdk-pixbuf/test-gdk-pixbuf.c:
+ Must... initialize... gobject...
+
+ * gdk-pixbuf/pixops/timescale.c:
+ * gtk/gtkcalendar.c:
+ Use g_malloc instead of malloc.
+
+2001-02-19 Alexander Larsson <alla@lysator.liu.se>
* gtk/testgtkrc:
Comment out property assignments, these don't work yet.
-2001-02-19 <alla@lysator.liu.se>
+2001-02-19 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkimage-fb.c (gdk_image_new_bitmap):
+ Copy data and free data with free().
+
+ * gdk-pixbuf/gdk-pixbuf.c:
+ * gdk-pixbuf/io-jpeg.c:
+ * gdk-pixbuf/io-png.c:
+ Use g_try_malloc/g_free instead malloc/free.
+
+ * gdk-pixbuf/test-gdk-pixbuf.c:
+ Must... initialize... gobject...
+
+ * gdk-pixbuf/pixops/timescale.c:
+ * gtk/gtkcalendar.c:
+ Use g_malloc instead of malloc.
+
+2001-02-19 Alexander Larsson <alla@lysator.liu.se>
* gtk/testgtkrc:
Comment out property assignments, these don't work yet.
-2001-02-19 <alla@lysator.liu.se>
+2001-02-19 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkimage-fb.c (gdk_image_new_bitmap):
+ Copy data and free data with free().
+
+ * gdk-pixbuf/gdk-pixbuf.c:
+ * gdk-pixbuf/io-jpeg.c:
+ * gdk-pixbuf/io-png.c:
+ Use g_try_malloc/g_free instead malloc/free.
+
+ * gdk-pixbuf/test-gdk-pixbuf.c:
+ Must... initialize... gobject...
+
+ * gdk-pixbuf/pixops/timescale.c:
+ * gtk/gtkcalendar.c:
+ Use g_malloc instead of malloc.
+
+2001-02-19 Alexander Larsson <alla@lysator.liu.se>
* gtk/testgtkrc:
Comment out property assignments, these don't work yet.
static void
free_buffer (guchar *pixels, gpointer data)
{
- free (pixels);
+ g_free (pixels);
}
/**
channels = has_alpha ? 4 : 3;
rowstride = 4 * ((channels * width + 3) / 4);
- buf = malloc (height * rowstride);
+ buf = g_try_malloc (height * rowstride);
if (!buf)
return NULL;
size = ((pixbuf->height - 1) * pixbuf->rowstride +
pixbuf->width * ((pixbuf->n_channels * pixbuf->bits_per_sample + 7) / 8));
- buf = malloc (size * sizeof (guchar));
+ buf = g_try_malloc (size * sizeof (guchar));
if (!buf)
return NULL;
static void
free_buffer (guchar *pixels, gpointer data)
{
- free (pixels);
+ g_free (pixels);
}
w = cinfo.output_width;
h = cinfo.output_height;
- pixels = malloc (h * w * 3);
+ pixels = g_try_malloc (h * w * 3);
if (!pixels) {
jpeg_destroy_decompress (&cinfo);
static void
free_buffer (guchar *pixels, gpointer data)
{
- free (pixels);
+ g_free (pixels);
}
/* Shared library entry point */
else
bpp = 3;
- pixels = malloc (w * h * bpp);
+ pixels = g_try_malloc (w * h * bpp);
if (!pixels) {
/* Check error NULL, normally this would be broken,
* but libpng makes me want to code defensively.
png_set_IHDR (png_ptr, info_ptr, w, h, bpc,
PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
- data = malloc (w * 3 * sizeof (char));
+ data = g_try_malloc (w * 3 * sizeof (char));
if (data == NULL) {
/* Check error NULL, normally this would be broken,
}
if (data)
- free (data);
+ g_free (data);
png_write_end (png_ptr, info_ptr);
png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
int filter_level;
- src_buf = malloc(src_rowstride * src_height);
+ src_buf = g_malloc(src_rowstride * src_height);
memset (src_buf, 0x80, src_rowstride * src_height);
- dest_buf = malloc(dest_rowstride * dest_height);
+ dest_buf = g_malloc(dest_rowstride * dest_height);
memset (dest_buf, 0x80, dest_rowstride * dest_height);
for (filter_level = GDK_INTERP_NEAREST ; filter_level <= GDK_INTERP_HYPER; filter_level++)
}
printf ("\n");
- free (src_buf);
- free (dest_buf);
+ g_free (src_buf);
+ g_free (dest_buf);
}
printf ("SCALE\n=====\n\n");
#include <stdlib.h>
#include "gdk-pixbuf.h"
+#include <gobject/gtype.h>
\f
int result;
result = EXIT_SUCCESS;
+
+ g_type_init (G_TYPE_DEBUG_NONE);
/* Run some tests. */
if (!simple_composite_test ()) {
image->bpp = 1;
image->bpl = (w+7)/8;
image->mem = g_malloc (image->bpl * h / 8);
+ memcpy (image->mem, data, image->bpl * h / 8);
+ /* This must be freed using free, not g_free, since in the X version
+ this is freed by xlib. */
+ free (data);
+
return image;
}
widget = GTK_WIDGET (calendar);
GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
- calendar->private_data = (gpointer) malloc (sizeof (GtkCalendarPrivateData));
+ calendar->private_data = (gpointer) g_malloc (sizeof (GtkCalendarPrivateData));
private_data = GTK_CALENDAR_PRIVATE_DATA (calendar);
if (!default_abbreviated_dayname[0])